package com.emip.util.report.impl;

import org.springframework.stereotype.Component;

import com.emip.bean.Store;
import com.emip.util.report.Comput;

@Component
public class SumComput extends Comput {

	double sum;
	
	public SumComput() {
		this.sum = 0;
	}
	
	@Override
	public void appendData(Store store) {
		double value = Double.parseDouble(store.getValue());
		this.sum += value;
	}

	public String getResult() {
		return count == 0 ? "" : sum + "";
	}

	public Comput newInstance() {
		return new SumComput();
	}

	public String getLabel() {
		return "总和";
	}

}
